package ruanjian.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import ruanjian.domain.Customer;

import java.util.List;

public interface CDao {
    @Select("select * from sys_customer")
    public List<Customer> selectCus();
    @Insert("select into sys_customer(cust_name,cust_source,cust_industry,cust_level,cust_mobile,cust_phone)" +
            "values(#{cust_name},#{cust_source},#{cust_industry},#{cust_level},#{cust_mobile},#{cust_phone})")
    public  int creatCus(Customer customer);
    @Select("select * from sys_customer where cust_id= #{id}")
    public Customer getCusid(Integer id);
    @Update("update sys_customer set cust_name=#{cust_name},cust_source=#{cust_source},cust_industry=#{cust_industry}," +
            "cust_level=#{cust_level},cust_mobile=#{cust_mobile},cust_phone=#{cust_phone} where cust_id=#{cust_id}")
    public  int updateCus(Customer customer);
    @Delete("delete from sys_customer where cust_id=#{id}")
    public  int deleteCus(Integer id);
}
